﻿using System;
namespace HB.WorkFlow
{
    /// <summary>
    /// 步骤过滤器
    /// </summary>
    public interface IStepFilter
    {
        /// <summary>
        /// 步骤执行前
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="step"></param>
        /// <param name="data"></param>
        void StepExecuting<T>(StepBody<T> step, T data) where T : class;
        /// <summary>
        /// 步骤执行后
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="step"></param>
        /// <param name="data"></param>
        void StepExecuted<T>(StepBody<T> step, T data) where T : class;
        /// <summary>
        /// 工作流开始运行
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="wf"></param>
        /// <param name="step"></param>
        /// <param name="data"></param>
        /// <param name="sampleId"></param>
        void WorkFlowStart<T>(WorkFlow<T> wf, StepBody<T> step, T data, string sampleId) where T : class;
        /// <summary>
        /// 分支工作流结束
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="wf"></param>
        /// <param name="step"></param>
        /// <param name="data"></param>
        /// <param name="sampleId"></param>
        void WorkFlowEnd<T>(WorkFlow<T> wf, StepBody<T> step, T data, string sampleId) where T : class;
        /// <summary>
        /// 路由导航事件
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="step"></param>
        /// <param name="data"></param>
        /// <param name="targetStep"></param>
        void RouteNavigated<T>(StepBody<T> step, T data, string targetStep) where T : class;
        /// <summary>
        /// 步骤节点发生错误
        /// </summary>
        /// <param name="ex"></param>
        void OnErr(Exception ex);

    }
}
